﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Events.aspx.cs" Inherits="Events" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Evevt</title>
</head>
<body>
    <form id="form1" runat="server">
   
  <h1>Events </h1>
   <asp:Label ID="LblTime" runat="server" Text="Label"></asp:Label>
  <hr />
    <div>
    
        For Page<br />
    <pre>
    protected void Page_Load(object sender, EventArgs e)
    {
       LblTime.Text = DateTime.Now.ToString();
        Page.Title = "Events";
        Response.Write("Page was loaded");
    }
</pre>
For Button 
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" 
            onload="Button1_Load" />
        <br />
<pre>
 protected void Button1_Click(object sender, EventArgs e)
    {
 Response.Write("Button Was clicked");
    }
</pre>

For Textboxes 
        <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True" 
            ontextchanged="TextBox1_TextChanged"></asp:TextBox>
            &nbsp;(Autopostback)
            <pre>
             protected void TextBox1_TextChanged(object sender, EventArgs e)
    {
        Response.Write("TextChanged Event fired with " + TextBox1.Text + "<br>");
    }
            
</pre>
 For Checkboxes       
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true" 
            oncheckedchanged="CheckBox1_CheckedChanged" />
            &nbsp;(Autopostback)<pre>
             protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
    {
        Response.Write("Checkbox was checked=" + CheckBox1.Checked.ToString() + "<br>");
    }
            
            </pre>
   For Radio Button 
        <asp:RadioButton ID="RadioButton1" runat="server" AutoPostBack="True" 
            oncheckedchanged="RadioButton1_CheckedChanged" />
    &nbsp;(Autopostback)</div>
    FDF<br />
    <a href="Default.aspx">Back</a>
    </form>
    </body>
</html>
